package client.network;

import shared.network.messages.TextMessage;

import com.jme3.network.Client;
import com.jme3.network.ClientStateListener;
import com.jme3.network.Message;
import com.jme3.network.MessageListener;

public class ClientListener implements MessageListener<Client>,ClientStateListener{

	@Override
	public void messageReceived(Client client, Message msg) {
		if(msg instanceof TextMessage)
		{
			System.out.println(msg.toString());
		}
	}

	@Override
	public void clientConnected(Client c) {
		System.out.println("Connected to " + c.getGameName() + ", Version: " + c.getVersion()+"\nWelcome to the Server!");
	}

	@Override
	public void clientDisconnected(Client c, DisconnectInfo info) {
		System.out.println("Disconnected from " + c.getGameName() + "Reason: " + info.reason);		
	}
	

}
